package ar.edu.unq.wannaplay.pages;

import org.apache.wicket.spring.injection.annot.SpringBean;

import ar.edu.unq.wannaplay.panels.LoginPanel;
import ar.edu.unq.wannaplay.services.DataGeneratorService;
import ar.edu.unq.wannaplay.services.UserService;

public class LoginPage extends WPPage {

    @SpringBean(name = "service.userService")
    private UserService loginService;

    @SpringBean(name = "service.dataGeneratorService")
    private DataGeneratorService generator;

    public LoginPage() {
        super("Login page");
        generator.initializeData();
        this.addFeedBackPanel();
        this.addMainContent();
        this.addLanguageSelect();
        this.addSectionTitle();
    }

    @Override
    protected void addMainContent() {
        this.add(new LoginPanel("mainContent", loginService, this.getFeedBackPanel()));
    }

    public UserService getLoginService() {
        return loginService;
    }

    public void setLoginService(final UserService loginService) {
        this.loginService = loginService;
    }

    public DataGeneratorService getGenerator() {
        return generator;
    }

    public void setGenerator(final DataGeneratorService generator) {
        this.generator = generator;
    }

}
